@use "sass:map" as map;
@use "common/vars.scss" as *;


#main {
  padding: 2.5rem 1.75rem;
}

#footer {
  display: flex;
  align-items: center;
  // color: var(--fg);
  max-width: calc(65ch + 5rem - 2px);
  margin: auto;
  padding: 3.25rem 2.5rem 5rem;
  font-size: .875rem;
  // line-height: 1.25rem;

  > span {
    @extend [hidden];
  }

  @media (min-width: 65ch) {
    padding-right: 0;
    padding-left: 0;
  }
}

#blogTitle {
  position: absolute;
  width: 2rem;
  height: 2rem;
  margin: 1.75rem;
  user-select: none;

  @media (min-width: 1024px) {
    position: fixed;
  }

  &::before,
  & > a {
    content: "";
    display: block;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
  }

  &::before {
    content: "";
    background-color: var(--accent);
  }

  & > a {
    position: absolute;
    top: 0;
    z-index: 1;

    > img {
      @extend [hidden];
    }
  }

  h2,
  h1 {
    @extend [hidden];
  }
}

#navigator {
  display: grid;
  grid-template-columns: auto max-content;
  padding: 2rem;

  &::before {
    content: "";
  }
}

#navList {
  display: flex;
  align-items: center;

  .menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 1.5rem;
    line-height: 0;
    font-size: 0;
    text-align: center;
    border-radius: 0.25rem;
    opacity: 0.6;
    transition: opacity .2s ease, color .2s ease;

    &:hover {
      color: var(--accent);
      opacity: 1;
    }

    &:not(#blog_nav_sitehome) {

      &::before {
        content: "";
        flex: 0 0 1.2rem;
        width: 1.2rem;
        height: 1.2rem;
        mask: var(--icon) no-repeat;
        mask-size: 100%;
        background-color: currentColor;
      }
    }

    &#blog_nav_sitehome::before {
      content: "cnblogs";
      font-size: 1rem;
      text-transform: uppercase;
      font-variant-caps: all-small-caps;
    }
    &#blog_nav_myhome {
      --icon: #{ map.get($icons, 'home') };
    }
    &#blog_nav_newpost {
      --icon: #{ map.get($icons, 'edit') };
    }
    &#blog_nav_contact {
      --icon:#{ map.get($icons, 'email') };
    }
    &#blog_nav_rss {
      --icon: #{ map.get($icons, 'rss2') };
    }
    &#blog_nav_admin {
      --icon: #{ map.get($icons, 'wikis') };
    }
  }

  & li:not(:first-child) .menu {
    margin-left: 1.2rem;
  }
}

#mainContent {
  margin: auto;
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.75;

  > [blackcat] {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-size: 2.25rem;
    line-height: 1.111111;

    a {
      border: none;
      font-weight: 700;
      color: var(--fg-darker);
      opacity: 0.2;

      &:hover {
        opacity: 0.5;
      }

      &.active {
        opacity: 1;
      }
    }
  }
}

#sideBar {
  position: fixed;
  top: calc(4.5rem + 2px);
  left: -18rem;
  bottom: 0;
  z-index: 5;
  width: 18rem;
  padding: 0.5rem;
  background-color: var(--bg);
  overflow: auto;
}

// Pagination
.topicListFooter {
  margin: 0;
  text-align: center;

  a {
    min-width: 2rem;
    margin: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--accent);
    outline: none;
    background-color: transparent;

    font-weight: 700;
    font-size: 0.875rem;
    line-height: calc(1.5rem - 2px);
    text-align: center;
    text-decoration: none;
    color: var(--accent);
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    user-select: none;

    transition: all 200ms;

    &:hover,
    &.span {
      background-color: var(--accent);
      color: #fff;
    }

    &:not(.span):active {
      opacity: .85;
    }
  }

  &#homepage_top_pager {
    @extend [hidden];
  }

  &#homepage_bottom_pager .pager {
    margin: 2rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;

    a:not(:last-child) {
      margin-right: 0.5rem;
    }
  }

  #nav_next_page a {
    position: relative;
    display: block;
    width: fit-content;
    margin: 2rem auto 0;
  }
}

#myposts .pager {
  text-align: center;
  margin: 2rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;

  a {
    min-width: 2rem;
    margin: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--accent);
    outline: none;
    background-color: transparent;

    font-weight: 700;
    font-size: 0.875rem;
    line-height: calc(1.5rem - 2px);
    text-align: center;
    text-decoration: none;
    color: var(--accent);
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    user-select: none;

    transition: all 200ms;

    &:hover,
    &.span {
      background-color: var(--accent);
      color: #fff;
    }

    &:not(.span):active {
      opacity: .85;
    }
  }

  a:not(:last-child) {
    margin-right: 0.5rem;
  }
}

// TagList
#taglist_title_wrap,
#MyTag1_dtTagList {
  @extend [hidden];
}

#taglist > div[blackcat] {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;

  > a {
    position: relative;
    padding: 0.2rem 0.75rem;
    color: var(--fg);
    background-color: var(--bg);
    border-radius: 0.25rem;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;

    &:hover {
      transform: translateY(-2px);
    }

    .dot {
      margin: 0 0.25rem;
    }
  }
}

@import "./common/_main";

@import "./partials/post";
@import "./partials/main-body-share";
#green_channel {
  width: 100%;
  padding: 10px;
}
#author_profile {
  width: 100%;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--divider);

  a:hover {
    text-decoration: none;
  }

  &_info {
    display: flex;
    float: none;
    line-height: normal;
    grid-gap: 8px;

    > a {
      display: flex;
      border-radius: 9999px;
      overflow: hidden;

      img {
        vertical-align: middle;
        float: none;
        margin-right: 0;
        padding-top: 0;
        padding-left: 0;
        transform: scale(1.1);
      }
    }
  }

  &_detail {
    float: none;
    font-size: 12px;

    > a:last-child {
      margin-left: 2px;
    }
  }
}
@import "./partials/main-body-comment";
@import "./partials/main-body-ad";
